package com.welink.web.test;

import java.io.IOException;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.welink.biz.common.model.NameDO;
import com.welink.biz.dao.name.NameManager;
import com.welink.web.common.action.BaseAction;

public class HelloAction extends BaseAction {

    private NameManager       nameManager;

    /** UUID */
    private static final long serialVersionUID = -4178034236590512367L;

    @Override
    public String execute() throws IOException {

        ActionContext context = ActionContext.getContext();

        context.put("Str", "aaaaa");

        // HttpServletRequest request = ServletActionContext.getRequest();
        context.put("name", "yonder");
        List<NameDO> list = nameManager.queryNames();
        if (null != list && list.size() > 0) {
            context.put("name", list.get(0).getName());
        }
        return SUCCESS;
    }

    //setters
    public void setNameManager(NameManager nameManager) {
        this.nameManager = nameManager;
    }
}
